home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group93b.txt
/
000036_icon-group-sender _Wed Apr 28 07:56:23 1993.msg
< prev
next >
Wrap
Internet Message Format
|
1993-06-16
|
2KB
Received: by cheltenham.cs.arizona.edu; Wed, 28 Apr 1993 07:46:17 MST
Date: 28 Apr 1993 07:56:23 -0600 (CST)
From: Chris Tenaglia - 257-8765 <TENAGLIA@mis.mcw.edu>
Subject: Re: Help!
To: icon-group@cs.arizona.edu
Message-Id: <01GXJCRBTCHU8WW7RY@mis.mcw.edu>
Organization: Medical College of Wisconsin (Milwaukee, WI)
X-Vms-To: in%"icon-group@cs.arizona.edu"
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-Transfer-Encoding: 7BIT
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
On Passing several variables In and several Out:
Structures and globals are the methods I use. Structures are better if
you have this as a widespread problem. Globals are useful in smaller
cases. I use globals a lot when converting a BASIC program into ICON.
----------------------------------------------------------------------
Method 1 : Use a structure
stuff := obtain(a,b,c)
...
# Using a List # Using a table
procedure obtain(a,b,c) or procedure obtain(a,b,c)
return [x,y,z] result := table("")
end result["x"] := 5*1.4
result["y"] := 22/7
result["z"] := ?25
return result
end
------------------------------------------------------------------------------
Method 2. Use globals
global x,y,z
procedure main()
...
obtain(a,b,c)
end
procedure obtain(a,b,c)
x := 5*1.3
y := 22/7
z := ?25
end
---------------------------------------------------------------------
Chris Tenaglia (System Manager) | "The past explained,
Medical College of Wisconsin | the future fortold,
8701 W. Watertown Plank Rd. | the present largely appologized for."
Milwaukee, WI 53226 | Organon to The Doctor
(414)257-8765 |
tenaglia@mis.mcw.edu